package com.ungao.framework.convert;

/**
 * 转换工具类
 *
 * @author vic-ungao
 */
public class CaseConverter {

    private CaseConverter() {
    }

    public void test(String name, int length) {

    }

    /**
     * 首字母大写转换
     *
     * @param content
     * @return
     */
    public static String toUpperCase(String content) {
        if (Character.isUpperCase(content.charAt(0))) {
            return content;
        }
        return new StringBuilder()
                .append(Character.toUpperCase(content.charAt(0)))
                .append(content.substring(1))
                .toString();
    }

    /**
     * 首字母小写转换
     *
     * @param content
     * @return
     */
    public static String toLowerCase(String content) {
        if (Character.isLowerCase(content.charAt(0))) {
            return content;
        }
        return new StringBuilder()
                .append(Character.toLowerCase(content.charAt(0)))
                .append(content.substring(1))
                .toString();
    }
}
